import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class demo8 {
    public static void main(String[] args) {

        List<String> list=new ArrayList<>();
        list.add("John Doe,john@doe.com");
        list.add("Bob Smith,bob@smith.com");
        func(list);
        System.out.println("=============");
    }
    public static Map<String,String> func(List<String> list){
        Map<String,String> ret=new HashMap<>();

        for(String x:list){
            int i=0;
            for(i=0;i<x.length();i++){
                if(x.charAt(i)==','){
                    break;
                }
            }
            String name=x.substring(0,i);
            String email=x.substring(i+1);
            ret.put(email,name);
        }
        return ret;
    }
}
